<template>
	<Form label-position="top">
        <FormItem label="是否启用">
            <RadioGroup v-model="value.type">
		        <Radio :label="1">启用</Radio>
		        <Radio :label="0">禁用</Radio>
		    </RadioGroup>
        </FormItem>
        <FormItem label="图片链接">
            <Input v-model="value.url"></Input>
        </FormItem>
        <FormItem label="上传图片">
        	<p class="ui-popupad-tip">请上传弹窗广告图片，建议尺寸：500 x 600 px。</p>
        	<div class="ui-popupad-upload">
        		<div class="upload">
        			<ImageUpload v-model="value.img"></ImageUpload>
        		</div>
        		<div class="icon">
        			<Icon type="ios-close-circle-outline" :size="32" color="#ffffff" />
        		</div>
        	</div>
        </FormItem>
   	</Form>
</template>

<script>
import ImageUpload from '@/views/diy/components/ImageUpload.vue';
export default {
	name: 'startPageConfig',
	components: {
		ImageUpload
	},
	props: {
		value: {
			type: Object,
			default: function() {
				return {};
			}
		}
	}
}
</script>

<style>
.ui-popupad-tip {
	position: absolute;
	left: 56px;
	top: -32px;
	color: #999;
	font-size: 12px;
}
.ui-popupad-upload {
	position: relative;
	width: 280px;
	height: 430px;
	background-color: #9d9d9d;
}
.ui-popupad-upload .upload {
	position: absolute;
	top: 66px;
	left: 40px;
	width: 200px;
	height: 240px;
	border-radius: 5px;
	background-color: #f9f6f6;
	overflow: hidden;
}
.ui-popupad-upload .icon {
	position: absolute;
	left: 50%;
	bottom: 66px;
	margin-left: -16px;
	width: 32px;
}
</style>